﻿CREATE TABLE [dbo].[EmergencyMessageContainer] (
    [DistributionCode]        VARCHAR (500) NULL,
    [SenderCode]              VARCHAR (500) NULL,
    [DateTimeSent]            DATETIME      NOT NULL,
    [DistributionStatus]      VARCHAR (50)  NULL,
    [DistributionType]        VARCHAR (50)  NULL,
    [CombinedConfidentiality] VARCHAR (500) NULL,
    [Language]                VARCHAR (50)  NULL,
    [DEXML]                   XML           NOT NULL,
    [Id]                      INT           IDENTITY (1, 1) NOT NULL
);


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Extracted XML elements from an Emergency Data Exchange Language (EDXL) document
as well as the XML document itself. The primary purpose of this document is to facilitate the routing to recipients of any properly formatted XML emergency messages.', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'EmergencyMessageContainer';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Contains a value assigned by the sender of the emergency messages that, when combined with the SenderCode column, uniquely identifies the emergency message container.', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'EmergencyMessageContainer', @level2type = N'COLUMN', @level2name = N'DistributionCode';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'The identifier of the sender of the emergency messages that, when combined with the DistributionCode column, uniquely identifies the emergency message container.', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'EmergencyMessageContainer', @level2type = N'COLUMN', @level2name = N'SenderCode';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Date and time that the emergency messages were sent.', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'EmergencyMessageContainer', @level2type = N'COLUMN', @level2name = N'DateTimeSent';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'The actionability of the emergency messages (e.g., regarding or supporting network functions, for technical testing only, "real-world" information for action).', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'EmergencyMessageContainer', @level2type = N'COLUMN', @level2name = N'DistributionStatus';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'The function of the emergency message container (e.g., report, update, cancel).', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'EmergencyMessageContainer', @level2type = N'COLUMN', @level2name = N'DistributionType';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Generally the most restrictive confidentiality of the emergency messages. Possibly more restrictive than any individual message.', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'EmergencyMessageContainer', @level2type = N'COLUMN', @level2name = N'CombinedConfidentiality';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'The primary, but not exclusive, language used in the emergency messages.', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'EmergencyMessageContainer', @level2type = N'COLUMN', @level2name = N'Language';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'The XML format of the emergency message container.', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'EmergencyMessageContainer', @level2type = N'COLUMN', @level2name = N'DEXML';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Primary key generated by the database management system.', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'EmergencyMessageContainer', @level2type = N'COLUMN', @level2name = N'Id';

